/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hcmus.fit.master.sevensea.sprite.ship;

import java.util.List;

import android.graphics.Bitmap;
import hcmus.fit.master.sevensea.background.Sea;

/**
 * 
 * @author hvp
 */
public class BlackPirate extends Ship {
    public static List<List<Bitmap>> Resource;
    public static int NumOfStatus;

    public BlackPirate(Sea seamap, int x, int y) {
        super(seamap, x, y);
        frames = Resource.get(Status);
        nbOfFrame = frames.size();
        FrameLibrary = Resource;
    }

    public BlackPirate(BlackPirate pirate) {
        super(pirate);
    }

    public void GetDirection(int targetX, int targetY) {
        // DestDirection
        int deltaX = targetX - X;
        int deltaY = targetY - Y;

        if (deltaX < 0 && deltaY < 0) {
            DestDirection = 7;
        }
        // trai
        if (deltaX < 0 && deltaY == 0) {
            DestDirection = 6;
        }

        // trai duoi
        if (deltaX < 0 && deltaY > 0) {
            DestDirection = 5;
        }

        // tren
        if (deltaX == 0 && deltaY < 0) {
            DestDirection = 0;
        }

        // duoi
        if (deltaX == 0 && deltaY > 0) {
            DestDirection = 4;
        }

        // phai tren
        if (deltaX > 0 && deltaY < 0) {
            DestDirection = 1;
        }
        // phai
        if (deltaX > 0 && deltaY == 0) {
            DestDirection = 2;
        }

        // phai duoi
        if (deltaX > 0 && deltaY > 0) {
            DestDirection = 3;
        }
    }

    public int GetScore() {
        return 30;
    }

    public boolean isEnemy() {
        return true;
    }
}
